home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
RTX2000.ZIP
/
rtx2000
/
monitor
/
gp
< prev
next >
Wrap
Text File
|
1992-11-01
|
958b
|
55 lines
( ********************* MODULE GP *********************************
General purpose FORTH words
)
xlink
: 0= ( x -- x )
( return TRUE if zero, FALSE otherwise )
if
FALSE
else
TRUE
then
;
xlink
: rot ( z y x -- y x z )
( Stardard FORTH rot function )
>r swap r> swap
;
xlink
: -rot ( z y x -- x z y )
( Rotate the other direction )
swap >r swap r>
;
: rotate_right ( x -- y )
( y = right rotate(x) )
dup c2/ drop ( put lsb into carry bit )
c2/ ( rotate carry into msb )
;
: u>= ( x y -- f )
( f = TRUE if x greater or equal to y, with x, y unsigned )
- c2/ 0<
;
: u< ( x y -- f )
( f = TRUE if x less then y, with x, y unsigned )
u>= not
;
: u> ( x y -- f )
( f = TRUE if x greater then y, with x, y unsigned )
swap u>= not
;
: u<= ( x y -- f )
( f = TRUE if x less then or equal to y, with x, y unsigned )
swap u>=
;